#import "ShaderLib/BaseCommon.glsllib"
//uniform mat3 g_WorldNormalMatrix;
#import "ShaderLib/Skinning.glsllib"
void main()
{
    vec3 tangentXYZ = iTangent.xyz;
    Skinning_Compute(boneMatrices, boneIndex, boneWeight, iPos, iNormal, tangentXYZ);
    
    oWorldPos = vec3(iMMat * iPos);
    //oNormal = mat3(iMMat) * iNormal;   
    oNormal = TransformWorldNormal2(iWNMat, iNormal);
    //oTangent = vec4(TransformNormal(iVMat, iMMat, iTangent.xyz).xyz, iTangent.w);
    oTangent = vec4(TransformWorldNormal2(iWNMat, tangentXYZ),iTangent.w);
    
    //vec3 nor    = mat3(iVMat) * iNormal;
    //oNormal     = normalize(vec3(nor.x,nor.y,nor.z)); 
    //nor         = mat3(iVMat) * iTangent.xyz;
    //oTangent    = vec4(normalize(vec3(nor.x,nor.y,nor.z)), iTangent.w);

    oPos =  iPVMat * vec4(oWorldPos, 1.0f);
}